﻿#include "MaterialFibersWapper.h"
#include "FITK_Kernel/FITKAppFramework/FITKMessage.h"

Fibers * MaterialFibersWapper::new_Fibers()
{
    return new Fibers;
}

void MaterialFibersWapper::delete_Fibers(Fibers * obj)
{
    if (obj) delete obj;
}

Fibers * MaterialFibersWapper::static_Fibers_GetFibers(const QString & name)
{
    return new Fibers(name);
}

QString MaterialFibersWapper::getName(Fibers * obj)
{
    if (obj)
        return obj->getName();
    return QString();
}

void MaterialFibersWapper::setName(Fibers * obj, const QString & name)
{
    if (!obj)return;
    bool ok = obj->setName(name);
    if (!ok) {
        AppFrame::FITKMessageError("Set Name failed !");
    }
}

void MaterialFibersWapper::setDensityResistivity(Fibers * obj, double density, double flowResistivity)
{
    if (!obj)return;
    bool ok = obj->setDensityResistivity(density, flowResistivity);
    if (!ok) {
        AppFrame::FITKMessageError("Set Density and Flow resistivity failed !");
    }
}

void MaterialFibersWapper::setRigidLimpFrame(Fibers * obj, double porosity, double tortuosity, double viscousLength, double thermalLength)
{
    if (!obj)return;
    bool ok = obj->setRigidLimpFrame(porosity, tortuosity, viscousLength, thermalLength);
    if (!ok) {
        AppFrame::FITKMessageError("Set Rigid/Limp Frame failed !");
    }
}

void MaterialFibersWapper::createMaterial(Fibers * obj, const QString & name)
{
    if (!obj)return;
    bool ok = obj->createMaterial(name);
    if (!ok) {
        AppFrame::FITKMessageError("Create Fiber Material failed !");
    }
}

Fibers::Fibers(const QString & name) :
    Acoustics::PyFITKMaterialsFibers(name)
{
}

Fibers::Fibers() :
    Acoustics::PyFITKMaterialsFibers()
{
}
